TOP := ..

INCLUDES=-I$(TOP)/includes -Imesoscopic2
CFLAGS=-g -Wall -fPIC -pthread -DDEBUG
PYTHON_HEADER=/usr/include/python2.7
PYTHON_WRAPPERS_DIR=../traci_interface
PYTHON_LIB=$(PYTHON_WRAPPERS_DIR)/_rsi.so

LIB=rsi


OBJECTS= log.o \
	utils.o \
	options/Options.o \
	controller/TLSController.o \
	controller/TimeIncrementCalculationStrategy.o \
	controller/Case.o \
	controller/CaseGroup.o \
	controller/CaseRecycler.o \
	localview/Network.o \
	localview/Edge.o \
	localview/Node.o \
	localview/LocalView.o  \
	localview/Link.o \
	localview/Phase.o \
    evolutive/TimeIncrementEvolutiveStrategy.o \
    evolutive/Dna.o \
	evolutive/CaseSelector.o \
	evolutive/EvolutiveCaseGenerator.o \
	evolutive/CaseGeneratorFactory.o \
	evolutive/FitnessFunction.o \
	evolutive/OffspringGenerator.o \
	evolutive/impl/NakamitFitnessFunction.o \
	evolutive/impl/RouletteWheelSelector.o \
	evolutive/impl/MesoscopicNetworkBuilder.o \
	evolutive/impl/StubLifeSimulator.o \
	evolutive/RandomCaseGen.o \
	evolutive/impl/MesoscopicTrafficSimulation.o \
	evolutive/EvolutiveCaseGeneratorBuilder.o \
	evolutive/output/CasesOutput.o \
	mesoscopic2/XMLOutputMesoscopicInterface.o \
	mesoscopic2/Controller.o \
	mesoscopic2/Network.o \
	mesoscopic2/SimulationNode.o \
	mesoscopic2/NodeInput.o \
	mesoscopic2/CarBundle.o \
	mesoscopic2/TLSPhase.o \
	mesoscopic2/TLSLink.o \
	mesoscopic2/NodeSource.o

include ../Makefile.mk

all: $(LIBFILE) $(PYTHON_LIB)

$(PYTHON_LIB): rsi.i $(OBJECTS)
	swig -c++ -python -outdir $(PYTHON_WRAPPERS_DIR) rsi.i
	g++ -c -fPIC rsi_wrap.cxx -o rsi_wrap.o $(INCLUDES) -I$(PYTHON_HEADER)
	g++ -shared $(OBJECTS) rsi_wrap.o -o $(PYTHON_LIB)

